<?php
class X_config{
    public static $_session_AutoStart= true;
    public static $_database_login= array();
    
    public static $mysql_charset= "UTF8";
    public static $mysql_tables= array();
    
    public static $mvc_defaultViewClass= "X_view";
    public static $mvc_i18n_database= "mysql";
    public static $mvc_routes_i18n= array();
    
    public static $i18n_langs= array('en'=>"English", 'fr'=>"Français");
    public static $i18n_langs_active= array('en'=>true, 'fr'=>false);
    public static $i18n_cache= true;
    public static $i18n_db_table= "X_i18n";
    public static $i18n_fillCacheBeforeBootstrap= false;
    public static $i18n_getLang= null; // null = &$_GET['lang']
    
    public static $stream_expiration= 3600; // Seconds (Default expiration time for new streams)
    public static $stream_timeout= 30; // Seconds (Maximum server stream search time before flushing an empty buffer)
    public static $stream_ajaxWait= 100; // ms (Time to wait before sending another request)
    public static $stream_interval= 400000; // Microseconds ( 400 000 = 400ms, Server will query the DB for new streams every 400ms, until timeout or new results found) 
    public static $stream_delayStart= 500; // ms (Delay the ajax stream after page load)
    public static $stream_dbTable= 'X_stream'; // Table name in database
    public static $stream_url= ''; // Table name in database

    public static $ajax_timeout=   2000;  // ms (Ajax Request Timeout before showing error message)
    
    
    public static function mysql_table($table, $fields, $primary="", $specs="", $force=false){
        if(!isset(X_config::$mysql_tables[$table]) || $force)X_config::$mysql_tables[$table]= array('table'=>$table,'fields'=>$fields,'primary'=>$primary,'specs'=>$specs);
    }
    
}
if(is_file(CONFIG_FILE_PATH))include_once CONFIG_FILE_PATH;

/*/////////////////////////////////////////////////////////////////////////////////////////////////////
// Typical Config file ( APPLICATION_PATH /config.php ) : 

X_config::$_database_login= array( // May be an array with multiple connection arrays
    'engine'=>    "mysql",
    'host'=>      "localhost",
    'user'=>      "",
    'password'=>  "",
    'database'=>  "",
    'flags'=>     null,
    'charset'=>   null,
);

X_config::$mvc_routes_i18n= array(
    'en'=> array('account'=>'Account', 'index'=>'Home'),
    'fr'=> array('account'=>'Compte', 'index'=>'Accueil'),
);

X_config::$i18n_langs= array('en'=>"English", 'fr'=>"Français");
X_config::$i18n_langs_active= array('en'=>true, 'fr'=>false);


switch(X_STAGE){default:
break;case 0 : // DEV

    X_config::$i18n_cache= false;



break;case 1 : // STAGING



break;case 2 : // PROD



break;}

/////////////////////////////////////////////////////////////////////////////////////////////////////*/